/* 遮罩层样式 */
.page-settings-panel-mask {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 999;
  pointer-events: none;
}

.page-settings-panel-mask.show {
  opacity: 1;
  pointer-events: auto;
}

/* 面板容器样式 */
.page-settings-panel {
  position: fixed;
  top: 60px;
  right: -500px;
  width: 480px;
  height: calc(100vh - 60px);
  background-color: #2c2c2c;
  border-left: 1px solid #444;
  box-shadow: -4px 0 12px rgba(0, 0, 0, 0.3);
  transition: right 0.3s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  color: #fff;
}

.page-settings-panel.open {
  right: 0;
}

/* 标题栏样式 */
.page-settings-panel-header {
  height: 60px;
  padding: 0 20px;
  border-bottom: 1px solid #444;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-settings-panel-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.close-btn {
  width: 24px;
  height: 24px;
  background-color: transparent;
  border: none;
  cursor: pointer;
  color: #999;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.close-btn:hover {
  color: #fff;
}

.close-btn::before {
  content: '×';
}

/* 内容区域样式 */
.page-settings-panel-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background-color: #252525;
}

/* 设置区块样式 */
.setting-section {
  margin-bottom: 25px;
}

.setting-section h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 500;
  color: #ccc;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.setting-row label {
  width: 35%;
  min-width: 80px;
  font-size: 14px;
  color: #ccc;
}

/* 输入框样式 */
input[type="number"],
input[type="text"],
input[type="color"],
select {
  padding: 8px 12px;
  background-color: #3a3a3a;
  border: 1px solid #555;
  border-radius: 4px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

input[type="number"]:focus,
input[type="text"]:focus,
input[type="color"]:focus,
select:focus {
  border-color: #007acc;
}

input[type="number"] {
  width: 80px;
}

input[type="text"] {
  flex: 1;
}

/* 颜色输入框样式 */
.color-input {
  width: 60px;
  height: 36px;
  padding: 0;
  cursor: pointer;
}

/* 文本输入框样式 */
.text-input {
  flex: 1;
}

/* 下拉选择框样式 */
select {
  flex: 1;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23999'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
  appearance: none;
}

/* 尺寸控制样式 */
.size-control {
  display: flex;
  align-items: center;
  gap: 4px;
}

.size-btn {
  width: 28px;
  height: 28px;
  background-color: #3a3a3a;
  border: 1px solid #555;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.size-btn:hover {
  background-color: #4a4a4a;
}

.size-input {
  width: 80px;
}

/* 边距输入框组样式 */
.margin-inputs {
  /* display: flex; */
  gap: 8px;
  flex: 1;
}

.margin-inputs input {
  flex: 1;
  text-align: center;
  min-width: 60px;
}

/* 按钮样式 */
.btn-minus,
.btn-plus {
  width: 28px;
  height: 28px;
  background-color: #3a3a3a;
  border: 1px solid #555;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.btn-minus:hover,
.btn-plus:hover {
  background-color: #4a4a4a;
}

.btn-browse {
  width: 36px;
  height: 36px;
  background-color: #3a3a3a;
  border: 1px solid #555;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.btn-browse:hover {
  background-color: #4a4a4a;
}

/* 预览区域样式 */
.preview-container {
  width: 100%;
  height: 150px;
  background-color: #3a3a3a;
  border: 1px solid #555;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.preview-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
      linear-gradient(45deg, #444 25%, transparent 25%),
      linear-gradient(-45deg, #444 25%, transparent 25%),
      linear-gradient(45deg, transparent 75%, #444 75%),
    linear-gradient(-45deg, transparent 75%, #444 75%);
  background-size: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
  opacity: 0.2;
  pointer-events: none;
}

.preview-canvas {
  background-color: #fff;
  border: 1px solid #999;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

/* 功能按钮样式 */
.btn-reset,
.btn-restore-default {
  padding: 8px 16px;
  background-color: #4a4a4a;
  border: 1px solid #555;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.btn-reset:hover,
.btn-restore-default:hover {
  background-color: #5a5a5a;
}

.btn-restore-default {
  margin-left: auto;
}

/* 单位样式 */
.unit {
  color: #999;
  font-size: 14px;
}

/* 底部按钮区域样式 */
.page-settings-panel-footer {
  padding: 20px;
  border-top: 1px solid #444;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background-color: #2c2c2c;
}

.cancel-btn,
.confirm-btn {
  padding: 10px 24px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.cancel-btn {
  background-color: #4a4a4a;
  color: #fff;
}

.cancel-btn:hover {
  background-color: #5a5a5a;
}

.confirm-btn {
  background-color: #007acc;
  color: #fff;
}

.confirm-btn:hover {
  background-color: #005a9e;
}

/* 滚动条样式 */
.page-settings-panel-content::-webkit-scrollbar {
  width: 8px;
}

.page-settings-panel-content::-webkit-scrollbar-track {
  background-color: #2a2a2a;
}

.page-settings-panel-content::-webkit-scrollbar-thumb {
  background-color: #555;
  border-radius: 4px;
}

.page-settings-panel-content::-webkit-scrollbar-thumb:hover {
  background-color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .page-settings-panel {
    width: 100%;
    right: -100%;
  }

  .setting-row label {
    width: 100%;
  }

  .input-group {
    justify-content: space-between;
  }

  input[type="number"] {
    width: 100px;
  }

  .margin-inputs {
    flex-wrap: wrap;
  }

  .margin-inputs input {
    min-width: 80px;
  }
}